<%--
  Created by IntelliJ IDEA.
  User: 东方九夜
  Date: 2021/6/17
  Time: 15:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="bean.*" %>
<%@ page import="dao.*" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Iterator" %>
<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8" />
		<title>论文上传</title>
		<link type="text/css" rel="stylesheet" href="css/index.css">
		<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
	</head>
	<body>
		<%
			Customer c = (Customer) request.getSession().getAttribute("student");
			if(c == null){
				response.sendRedirect("Not_Login.jsp");
			}
		%>
		<div class="main">
			<div class="navigation">
				<span>欢迎回来! 
					<%
						if(c != null){
							out.print(c.getName());
						}
					%>
				</span>
				<a class="exit" href="index.jsp"><span>退出登录</span></a>
				<a class="exit" href="Alter_Pwd.jsp"><span>修改密码</span></a>
				<a class="exit" href="Student_Info.jsp?ID=<%=c.getId()%>"><span>修改信息</span></a>
			</div>
			<table class="table" style="margin:0 auto;width:90%">
				<tr>
					<td style="width:20%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='index_Student.jsp'">公告</button>	</td>
					<td style="width:20%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='UploadPaper.jsp'">论文上传</button></td>
					<td style="width:20%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='MyGrade.jsp'">成绩查询</button></td>
				</tr>
			</table>
			<div>
				<%
					String ID = c.getId();
					GradeDesign gradeDesign = StudentSql.selectDesign(ID);
					if(gradeDesign == null) {
						gradeDesign = StudentSql.selectDesignInCustomer(ID);
					}
				%>
				<form action="UploadServlet" method="post" enctype="multipart/form-data">
					<table class="table table-hover; table_center" style="margin:0 auto;width:90%;color: white">
						<tr>
							<td >ID:<%=gradeDesign.getID()%></td>
							<td>名字:<%=gradeDesign.getName()%></td>\
							<td>
								<div class="form-group">
									<label >课题</label>
									<input type="text" name="Title" value="<%=gradeDesign.getTitle()%>" style="color: black"/>
								</div>
							</td>
							<td>
								<div class="form-group">
									<label >课题</label>
									<input type="text" name="Title" value="<%=gradeDesign.getTitle()%>" style="color: black"/>
								</div>
							</td>
							<td>指导教师:<%=gradeDesign.getT_Name()%></td>
						</tr>
						<tr>
							<td>
								<div class="form-group">
									<label >学院</label>
									<input type="text" name="Depart" value="<%=gradeDesign.getDepart()%>" style="color: black"/>
								</div>
							</td>
							<td></td>
							<td>
								<div class="form-group">
									<label >专业</label>
									<input type="text" name="Major" value="<%=gradeDesign.getMajor()%>" style="color: black"/>
								</div>
							</td>
							<td></td>
							<td>
								<div class="form-group">
									<label >电话</label>
									<input type="text" name="Phone" value="<%=gradeDesign.getPhone()%>" style="color: black"/>
								</div>
							</td>
						</tr>
						<tr>
							<td>
								<label >任务书</label>
							</td>
							<td></td>
							<td>
								<div class="form-group">
									<label >文件名称:<%=gradeDesign.getRWS()%></label>
								</div>
							</td>
							<td></td>
							<td>
								<input type="file" name="RWS" id="RWS"/>
							</td>
						</tr>
						<tr>
							<td>
								<label >开题报告</label>
							</td>
							<td></td>
							<td>
								<div class="form-group">
									<label >文件名称:<%=gradeDesign.getKTBG()%></label>
								</div>
							</td>
							<td></td>
							<td>
								<input type="file" name="KTBG" id="KTBG"/>
							</td>
						</tr>
						<tr>
							<td>
								<label >毕业论文</label>
							</td>
							<td></td>
							<td>
								<div class="form-group">
									<label >文件名称:<%=gradeDesign.getBYLW()%></label>
								</div>
							</td>
							<td></td>
							<td>
								<input type="file" name="BYLW" id="BYLW"/>
							</td>
						</tr>
						<tr>
							<td>
								<label >相关代码</label>
							</td>
							<td></td>
							<td>
								<div class="form-group">
									<label >文件名称:<%=gradeDesign.getCODE()%></label>
								</div>
							</td>
							<td></td>
							<td>
								<input type="file" name="CODE" id="CODE"/>
							</td>
						</tr>
						<tr>
							<td></td>
							<td></td>
							<td></td>
							<td></td>
							<td>
								<input type="hidden" name="ID" value="<%=ID %>" />
								<input type="hidden" name="Name" value="<%=gradeDesign.getName() %>" />
								<button type="submit" class="btn btn-default btn-sm" >提交</button>
							</td>
						</tr>
					</table>
				</form>
			</div>
			<div class="clear"></div>			
		</div>

	</body>
</html>
